@extends('layouts.admin')
@section('content')
    <div id="ribbon"><ol class="breadcrumb"><li>内容区</li></ol></div>
    <div class="content_wrapper">
        <aside>
            <header><i class="fa fa-fw fa-file"></i>数据保存</header>
            <section>
                <div class="row">
                    <div class="col-sm-12">
                        <form id="dataForm" onsubmit="return false;" class="form-horizontal" role="form">
                            <input type="hidden" name="id" value="">
                            <div class="form-group">
                                <label class="col-sm-2 control-label">关键词</label>
                                <div class="col-sm-3">
                                    <input type="text" class="form-control" placeholder="多个关键词用逗号分隔" name="keyword" value="{{$item['keyword'] or ''}}" maxlength="20">
                                </div>
                            </div>
                            <hr/>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">标题</label>
                                <div class="col-sm-3">
                                    <input type="text" class="form-control" placeholder="" name="title" value="{{$item['title'] or ''}}" maxlength="30">
                                </div>
                            </div>
                            <hr/>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">封面图</label>
                                <div class="col-sm-3">
                                    <div class="form-control" id="pic_div" style="cursor:pointer;">点击上传</div>
                                    <input type="hidden" id="pic" name="pic" value="{{$item['pic'] or ''}}" />
                                </div>
                                <p class="col-sm-7 help-block">建议尺寸：540x300像素</p>
                            </div>
                            <div class="form-group" style="display:{{empty($item['pic']) ? 'none' : 'block'}}">
                                <label class="col-sm-2 control-label"> </label>
                                <div class="col-sm-3">
                                    <img id="pic_img" src="{{$item['pic'] or ''}}" alt="图片" style="height:150px;max-width:250px;">
                                </div>
                            </div>
                            <hr/>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">跳转链接</label>
                                <div class="col-sm-3">
                                    <input type="text" class="form-control" placeholder="选填" name="url" value="{{$item['url'] or ''}}">
                                </div>
                                <p class="col-sm-7 help-block">如：http://www.baidu.com</p>
                            </div>
                            <hr/>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">回复内容</label>
                                <div class="col-sm-5" style="position: relative">
                                    <textarea id="text_content" name="content" style="width:800px;height:300px;">{{$item['content'] or ''}}</textarea>
                                </div>
                            </div>
                            <hr/>
                            <div class="form-group">
                                <label class="col-sm-2 control-label"> </label>
                                <div class=" col-sm-10">
                                    <input type="button" class="btn btn-primary" value="保存" id="saveBtn" onclick="save()" />&nbsp;&nbsp;&nbsp;
                                    <input type="button" class="btn btn-default" value="返回" onclick="history.go(-1)" />
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </section>
        </aside>
    </div>
@endsection